<template>
  <div class="table_page">
    <el-table :data="tableData" @selection-change="selectionChange" :header-cell-style="{background: '#F8FBFF'}">
      <slot name="table_column"></slot>
    </el-table>
    <slot name="handleoperation"></slot>
    <el-pagination v-if="totalPage > 0" class="table_page_number" background layout="prev, pager, next" :small="true" :current-page="currentPage" :total="totalPage" @current-change="currentChange"></el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    currentPage: {
      type: Number,
      default: 1
    },
    totalPage: {
      type: Number,
      default: 1
    }
  },
  methods: {
    selectionChange (selection) {
      this.$emit('table-checked', selection);
    },
    currentChange (currentPage) {
      this.$emit('changPage', currentPage);
    }
  }
};
</script>

<style lang="less" scoped>
  .table_page_number {
    margin-top: 35px;
    font-weight: normal;
    text-align: center;
  }
</style>
